When taking the first ending in a piece of music that has a repeat in it, you play or sing right through the section marked 1 till you get to the repeat sign. Then go back to the beginning of the repeated passage.
Of course, on the next time through the repeated passage, you'll skip the first ending and play or sing the second ending, which is marked with a 2, right through to its end. If there's yet another repeat sign at the end of that, you’ll go through a third time and take the third ending, which is marked with a 3, and so on — but not many pieces of music have more than two repeats and three endings!